using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.RepositoryFactory.SchemaDiscovery.ObjectModel.Base;

namespace Microsoft.Practices.RepositoryFactory.CustomPages.Validators
{
    internal class ColumnValidator : IValidator
    {
        #region Properties
        private Column column;

        public Column Column
        {
            get { return column; }
            set { column = value; }
        }

        #endregion
        #region Constructors
        public ColumnValidator()
        {
        }

        public ColumnValidator(Column column)
        {
            this.column = column;
        }
        #endregion

        #region IValidator Members

        public bool IsValid()
        {
            if(column != null)
            {
                return (column.DbDataType.ProviderType != DatabaseType.Object &&
                    column.DbDataType.ProviderType != DatabaseType.NotSupported);
            }
            else 
            {
                return false;
            }
        }

        #endregion
    }
}
